Skip to content

⬆ Bump time-machine to 3.2.0#257

Merged
patrick91 merged 7 commits into
mainfrom
bump-time-machine-to-3.x
Jun 22, 2026
Merged

⬆ Bump time-machine to 3.2.0#257
patrick91 merged 7 commits into
mainfrom
bump-time-machine-to-3.x

Conversation

@YuriiMotov

@YuriiMotov YuriiMotov commented Jun 18, 2026

Copy link
Copy Markdown
Member

Upgrading time-machine to version 3.x requires fixing test that mocks the monotonic using time_machine.shift.

Since version 3.0.0, time-machine doesn't mock time.monotonic (see release notes). So, test_stream_build_logs_retry_timeout tests started to fail.
I fixed it in 1109caa.

There are 3 more tests that are somehow related to logic that uses monotonic:

  • test_fetch_access_token_uses_default_timeout - already uses patch with side_effect - no changes needed
  • test_short_wait_messages - mocked monotonic incorrectly
  • test_long_wait_messages - mocked monotonic incorrectly

test_short_wait_messages and test_long_wait_messages didn't fail because they didn't actually tested what they claimed (didn't test that expected "long wait" or "short wait" messages appear in output).
So, I updated these 2 tests to actually test that arrays with messages are accessed (see commit 6ea3ee8), and then test_long_wait_messages test started to fail (as expected).
I fixed the way these tests mock monotonic as well in commits 37781be and 85c3b80

@YuriiMotov YuriiMotov added the internal Internal changes label Jun 18, 2026
Comment thread tests/test_api_client.py Outdated
@YuriiMotov YuriiMotov marked this pull request as ready for review June 18, 2026 18:59
@YuriiMotov YuriiMotov requested a review from patrick91 June 18, 2026 18:59
@YuriiMotov YuriiMotov changed the title ⬆ Bump time machine to 3.2.0 ⬆ Bump time-machine to 3.2.0 Jun 18, 2026
@patrick91 patrick91 merged commit c83ecf2 into main Jun 22, 2026
21 checks passed
@patrick91 patrick91 deleted the bump-time-machine-to-3.x branch June 22, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Internal changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants